package sketchpad.gui.component.utils;

import com.jfoenix.svg.SVGGlyph;
import com.jfoenix.svg.SVGGlyphLoader;
import sketchpad.constant.SketchPadColor;

public final class ItemIco {

    private final SVGGlyph triangle;
    private final SVGGlyph rectangle;
    private final SVGGlyph circle;
    private final SVGGlyph random;
    private final SVGGlyph select;
    private final SVGGlyph group;

    private static final String FX_BACKGROUND_COLOR = "-fx-background-color: ";

    public ItemIco() throws Exception{
        SVGGlyphLoader.loadGlyphsFont(getClass().getResource("/fonts/icomoon.svg"));

        triangle = SVGGlyphLoader.getIcoMoonGlyph("icomoon.svg.caret-up");
        triangle.setSize(20,20);
        triangle.setStyle(FX_BACKGROUND_COLOR+ SketchPadColor.COLOR_TRIANGLE);

        rectangle = SVGGlyphLoader.getIcoMoonGlyph("icomoon.svg.square");
        rectangle.setSize(20,20);
        rectangle.setStyle(FX_BACKGROUND_COLOR+ SketchPadColor.COLOR_RECTANGLE);

        circle = SVGGlyphLoader.getIcoMoonGlyph("icomoon.svg.circle");
        circle.setSize(20,20);
        circle.setStyle(FX_BACKGROUND_COLOR+ SketchPadColor.COLOR_CIRCLE);

        random = SVGGlyphLoader.getIcoMoonGlyph("icomoon.svg.openid");
        random.setSize(20,20);
        random.setStyle(FX_BACKGROUND_COLOR+ SketchPadColor.COLOR_RANDOM);

        select = SVGGlyphLoader.getIcoMoonGlyph("icomoon.svg.list");
        select.setSize(20,20);
        select.setStyle(FX_BACKGROUND_COLOR+ SketchPadColor.COLOR_SELECTED);

        group = SVGGlyphLoader.getIcoMoonGlyph("icomoon.svg.stack");
        group.setSize(20,20);
        group.setStyle(FX_BACKGROUND_COLOR+ SketchPadColor.COLOR_GROUP);
    }

    public SVGGlyph getTriangle() {
        return triangle;
    }

    public SVGGlyph getRectangle() {
        return rectangle;
    }

    public SVGGlyph getCircle() {
        return circle;
    }

    public SVGGlyph getRandom() {
        return random;
    }

    public SVGGlyph getSelect() {
        return select;
    }

    public SVGGlyph getGroup() {
        return group;
    }
}
